import request from '@/request'
const URL = process.env.VUE_APP_API

// 菜单列表
export function diclistByType(params) {
  return request({
    url: `${URL}/manage/upmsDicData/listByType`,
    method: 'get',
    params
  })
}

// 字典列表
export function getDictList(data) {
  return request({
    url: `${URL}/manage/upms/dict/search`,
    method: 'post',
    data
  })
}

// 字典详情
export function getDictDetail(params) {
  return request({
    url: `${URL}/manage/upms/dict/detail`,
    method: 'get',
    params
  })
}

// 新增字典
export function addDict(data) {
  return request({
    url: `${URL}/manage/upms/dict/add`,
    method: 'post',
    data
  })
}

// 编辑字典
export function updateDict(data) {
  return request({
    url: `${URL}/manage/upms/dict/update`,
    method: 'post',
    data
  })
}

// 代码类别
export function getDictTypes(params) {
  return request({
    url: `${URL}/manage/upms/dict/types`,
    method: 'get',
    params
  })
}
